Page({
  data: {
    currentTab: 0,
    timeTabs: [
      { label: '近7天', value: 7 },
      { label: '近30天', value: 30 },
      { label: '近90天', value: 90 }
    ],
    recordList: [
      {
        id: 1,
        date: '2024-01-20',
        data: [
          { type: 'heart', label: '心率', value: '72次/分' },
          { type: 'blood', label: '血压', value: '120/80mmHg' },
          { type: 'sugar', label: '血糖', value: '5.6mmol/L' }
        ]
      },
      {
        id: 2,
        date: '2024-01-19',
        data: [
          { type: 'heart', label: '心率', value: '75次/分' },
          { type: 'blood', label: '血压', value: '118/78mmHg' },
          { type: 'sugar', label: '血糖', value: '5.4mmol/L' }
        ]
      }
    ]
  },

  onTabChange(e) {
    const index = e.currentTarget.dataset.index;
    this.setData({ currentTab: index });
  }
})
